<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<link rel="stylesheet" href="css/header.css">
<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
<link rel="stylesheet" href="css/shopping.css">
<script src="js/vue.min.js"></script>
<script src="https://unpkg.com/element-ui/lib/index.js"></script>

<body>
    <div class="app">
        <header>
            <div class="projectName">汽车轴承寿命预测平台</div>
            <el-input placeholder="搜索" clearable style="width: 10vw;margin: 10px"></el-input>
            <el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal" @select="handleSelect">
                <el-menu-item index="1" onclick=""><a href="uindex.jsp">首页</a></el-menu-item>
                <el-menu-item index="2"><a href="ShoppingServlet">商城</a></el-menu-item>
                <el-menu-item index="3"><a href="OrderListServlet">购物车</a></el-menu-item>
                <el-menu-item index="4"><a href="mine.jsp" target="_blank">我的</a></el-menu-item>
            </el-menu>
        </header>
        <div style="width: 100vw; height: fit-content;">
            <img src="img/zhou4.jpg" alt="" style="width: 100%;">
        </div>
        <div class="seek" style="display: flex; line-height: 60px">
            <el-input placeholder="轴承类型" clearable style="width: 10vw;margin: 10px"></el-input>
            <el-button type="primary" icon="el-icon-search" class="seekbtn">搜索</el-button>
        </div>
        <div class="msg">采购轴承，找进口轴承供应商，专注轴承传动领域，承载更多梦想！</div>
        <div class="bearingList">
            <c:forEach var="bearings" items="${bearings}">
            <div class="item">
                <img src=${bearings.imgSrc} alt="" style="width: 20vw;height: auto;">
                <p class="name">名称:&nbsp;${bearings.type}</p>
                <p>价格:&nbsp; ￥${bearings.price}</p>
                <button style="text-align: center;" class="price"><a href="BearingDetailServlet?id=${bearings.id}">进入详情</a></button>
            </div>
            </c:forEach>
        </div>
    </div>
</body>
<script>
    new Vue({
        el: '.app',
        data() {
            return {
                activeIndex: '2',
                activeIndex2: '2'
            }
        }, methods: {
            handleSelect(key, keyPath) {
                console.log(key, keyPath);
            }
        }
    })
</script>

</html>